let courtScene = require('./courtScene');//现场庭审
let caseFile = require('../component/caseFile');//读写案件信息

/**
 * 庭审模块脚本
 * @param pupConfig 基础配置信息
 * @param caseInfo 案件信息,详见component/caseFile.js
 */
const start = async (pupConfig, caseInfo) => {
  caseInfo =await caseFile.read(caseInfo);

  //庭审类型，0是现场受理，1是书面受理。默认为0。
  let {courtType = 0} = caseInfo;
  //目前，书面审理与现场审理的流程完全一致
  if (courtType === 0) {
    await courtScene(pupConfig, caseInfo);
  } else if (courtType === 1) {
    await courtScene(pupConfig, caseInfo);
  }

  return caseInfo;
}

module.exports = start;